package com.yunzone.cloud.module.order;


import com.yunzone.cloud.common.entity.Result;
import com.yunzone.cloud.module.pay.service.PaymentFeignService;
import com.yunzone.cloud.modules.payment.entity.Payment;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/query/{id}")
    public Result<Payment> queryOrder(@PathVariable("id") long id){
        return paymentFeignService.query(id);
    }

    @GetMapping("/create")
    public Result<Payment> queryOrder(Payment payment){
        return paymentFeignService.add(payment);
    }

    @GetMapping("/timeout")
    public String timeout(Payment payment){
        return paymentFeignService.timeout();
    }

}





